import { Module, VuexModule, Mutation, Action } from 'vuex-module-decorators';
import store from "@/store"

@Module({name: 'Auth', namespaced: true, store})
export default class Auth extends VuexModule {
    public count: number = 12;

    // action 'decr' commits mutation 'decrement' when done with return value as payload
    @Action({ commit: 'decrement'})
    public async decr() {
       return 5;
    }

    @Mutation
    private decrement(delta: number) {
        console.log('delta', delta);
        this.count -= delta;
    }
}
